#ifndef __DYNAMICARRY_H_
#define __DYNAMICARRY_H_


#include <stdbool.h>

typedef void* ElementType;

struct DynamicArray;

typedef struct DynamicArray DArray;

// 创建一个动态数组
DArray *InitDArray(int capacity, void (*FreePtr)(ElementType p));
// 释放动态数组

bool InsertTail(DArray *a, ElementType element);

void FreeDArray(void*a);

void DeleteValue(DArray *a, int element);

void DeleteByElement(DArray *a, ElementType element);

void PrintArray(DArray *a, void (*printf)(ElementType p));

// 查找某一个元素
ElementType FindElement(DArray *a, ElementType element, bool (*find)(ElementType, ElementType));



#endif